import request from '@/utils/request'

export function list(param){
  return request({
    url: '/sys/auth/list',
    method: 'get',
    params: param
  })
}
export function listByUnCond(param){
    return request({
      url: '/sys/auth/listByUnCond',
      method: 'get',
      params: param
    })
  }

export function getById(id){
  return request({
    url: '/sys/auth/getById/' +id,
    method: 'get'
  })
}

export function add(data){
  return request({
    url: '/sys/auth/add',
    method: 'post',
    data: data
  })
}
export function edit(data){
  return request({
    url: '/sys/auth/edit',
    method: 'post',
    data: data
  })
}
export function remove(id){
  return request({
    url: '/sys/auth/remove',
    method: 'post',
    data: {"id":id}
  })
}

export function listByGroupId(groupId) { 
    return request({
        url: '/sys/auth/listByGroupId/'+ groupId,
        method: 'get'
    })
}

export function authByGroup(data) { 
    return request({
        url: '/sys/auth/authByGroup',
        method: 'post',
        data: data
    })
}


export function listGroup(param){
    return request({
      url: '/sys/auth/group/list',
      method: 'get',
      params: param
    })
  }
  
  export function getGroupById(id){
    return request({
      url: '/sys/auth/group/getById/' +id,
      method: 'get'
    })
  }
  
  export function addGroup(data){
    return request({
      url: '/sys/auth/group/add',
      method: 'post',
      data: data
    })
  }
  export function editGroup(data){
    return request({
      url: '/sys/auth/group/edit',
      method: 'post',
      data: data
    })
  }
  export function removeGroup(id){
    return request({
      url: '/sys/auth/group/remove',
      method: 'post',
      data: {"id":id}
    })
  }